"""f210112 f21010512白彬彬"""
import cv2
# 加载图像
image = cv2.imread("E:\photo\Ex01_butterfly01.jpg", cv2.IMREAD_GRAYSCALE)

# 初始化SURF对象
surf = cv2.xfeatures2d.SURF_create()

# 检测特征点
keypoints, descriptors = surf.detectAndCompute(image, None)

# 绘制特征点
image_with_keypoints = cv2.drawKeypoints(image, keypoints, None)

# 显示结果
cv2.imshow('Image with Keypoints', image_with_keypoints)
cv2.waitKey(0)
cv2.destroyAllWindows()

#在较新的OpenCV版本中，xfeatures2d模块已被移除